/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**
 *  @author     Andrew Wei
 *  @portfolio  http://andrewwei.mu
 *
 *  ©2012 Andrew Wei
 *
 *  This software is released under the MIT License:
 *  http://www.opensource.org/licenses/mit-license.php
 **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**/
package com.ghoztudios.helper
{
    import flash.utils.ByteArray;

    /**
     * A static class containing a bunch of handy helper functions for
     * manipulating objects.
     *
     * @langversion     3.0
     * @playerversion   Flash 10.3.183.20
     */
    public class Scientist
    {
        private static const ID:String = 'com.ghoztudios.helper.Scientist';

        // Public Methods
        /**
         * Clones the object.
         *
         * @param   $subject
         * @return  A clone of the object.
         * @langversion     3.0
         * @playerversion   Flash 10.3.183.20
         */
        public static function clone($subject:Object):Object
        {
            var buffer:ByteArray = new ByteArray();
            buffer.writeObject($subject);
            buffer.position = 0;

            var result:Object = buffer.readObject();
            return result;
        }
    }
}
